package model.layer;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class User implements KvmSerializable {

	private int id; 
	private String userName;
	private String mac;

	
	
	public User(int _id, String _userName, String _mac)
	{
		this.id =_id;
		this.userName = _userName;
		this.mac = _mac;
	}
	
	public User()
	{
		
	}
	

	@Override
	public Object getProperty(int arg0) {
		
		switch(arg0)
		{
			case 0: return id;
			
			case 1: return userName;
			
			case 2: return mac;
		
		}
		return null;
	}

	@Override
	public int getPropertyCount() {
		
		return 3;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
		
        switch(index)
        {
        case 0:
            info.type = PropertyInfo.INTEGER_CLASS;
            info.name = "Id";
            break;
        case 1:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "UserName";
            break;
        case 2:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "Mac";
            break;
        default:break;
        }
		
	}

	@Override
	public void setProperty(int index, Object value) {
        switch(index)
        {
        case 0:
            id = Integer.parseInt(value.toString());
            break;
        case 1:
            userName = value.toString();
            break;
        case 2:
            mac = value.toString();
            break;
        default:
            break;
        }
		
	}
	

	
	
}
